home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Megahits 5
/
Megahits 5 (1994)(GTI - Rhein-Main-Soft)(DE)(Disc 2 of 2)[!].iso
/
archive
/
print
/
dvi2pcl.lha
/
storechar.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-25
|
1KB
|
45 lines
/*
* Does similar things as down_character, but instead of putting
* the character's pixel pattern in the bitfile it is stored in dynamicaly
* allocated memory, used for drawing the character in graphic mode. In
* graphic mode the meaning for x_offset and y_offset is different from
* downloaded characters and the pixel pattern is stripped off from pending
* zero bytes in each row.
*/
#include "globals.h"
void storechar(c)
int c;
{
byte *q, *p;
int i;
int width;
int height;
long length;
gcharfmt *g;
pktopxl(c);
g = &(*gfont)[c];
if(landscape) {
p = (byte *)rotatechar();
g->pxl_bytes = width = (c_height + 7)/8;
g->pxl_rows = height = c_width;
g->x_offset = height - c_hoffset - 1;
g->y_offset = -c_voffset;
}
else {
p = (byte *) pxlbuffer;
g->pxl_bytes = width = (c_width + 7)/8;
g->pxl_rows = height = c_height;
g->x_offset = -c_hoffset;
g->y_offset = -c_voffset;
}
length = height*width;
g->pxl_pattern = (byte *)malloc(length);
q = g->pxl_pattern;
for(i = 0 ; i < length ; i ++)
*q++ = *p++;
}